package org.xs.object.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.xs.object.dao.class_table.MenuEntry;
import org.xs.object.service.IHomeService;
import org.xs.object.utils.R;
import org.xs.object.utils.ResponseEnum;

import java.util.ArrayList;
import java.util.Map;


@Service
public class HomeService implements IHomeService{

    @Autowired
    private MenuConfigService menuConfigService;
    @Override
    public R<ArrayList<Map<String, MenuEntry>>> GetData() {
        ArrayList<Map<String, MenuEntry>> data = menuConfigService.loadMenuConfig();
        if (data == null){
            return R.error(ResponseEnum.FAIL);
        }
        return R.ok(data);
    }
    @Override
    public R GetHomeData(){

        return null;
    }
}

